__author__ = 'guojl'
from django.contrib import admin
from MyBlog.Blog.models import *


class Articledmin(admin.ModelAdmin):
    exclude = ("updatetime","addtime")
    list_filter=('title',)
#    filter_horizontal = ('category','tag')
    search_fields = ('title','content')
    class Media:
        js=('http://static.guojl.com/js/tiny_mce/tiny_mce.js',
            'http://static.guojl.com/js/textareas.js'
            )


class CommentAdmin(admin.ModelAdmin):
    list_display=('article','content')

class BlogImageAdmin(admin.ModelAdmin):
    class Media:
        js=('http://static.guojl.com/js/resizeimg.js',)
    list_display = ('showimg','showurl','remark','timeformate')
    exclude = ('addtime',)

admin.site.register(BlogImage,BlogImageAdmin)
admin.site.register(Article,Articledmin)
admin.site.register(Tag)
admin.site.register(Hit)
admin.site.register(Comment,CommentAdmin)
admin.site.register(Category)
